<template>
  <div id="app">
    <el-container>
      <el-aside width="250px">
        <div style="height: 60px;line-height: 60px;text-align: center">
          <p style="color:black;font-size: larger">采购信息</p>
        </div>
        <div>
          <el-button class="back-button" type="text" @click="goBack">
            <i class="el-icon-arrow-left"></i> 返回
          </el-button>
        </div>
        <el-dialog title="采购信息" :visible.sync="dialogFormVisible">
          <el-form :model="form">
            <el-form-item label="采购记录编号" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="采购餐具名称" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="采购数量" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="采购日期" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="供应商" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="备注" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
          </div>
        </el-dialog>

      </el-aside>
      <el-main>
        <!-- 表格展示数据 -->
        <el-table :data="tableData" border stripe header-cell-class-name="headerBg">
          <el-table-column prop="PurchaseID" label="采购记录编号"width="120"></el-table-column>
          <el-table-column prop="PName" label="采购餐具名称" width="140"></el-table-column>
          <el-table-column prop="PNum" label="采购数量" width="120"></el-table-column>
          <el-table-column prop="PTme" label="采购日期"width="120"></el-table-column>
          <el-table-column prop="From" label="供应商"width="120"></el-table-column>
          <el-table-column prop="Others" label="备注"width="120"></el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button type="success">编辑<i class="el-icon-edit"></i></el-button>
              <el-button type="danger">删除<i class="el-icon-remove-outline"></i></el-button>
            </template>
          </el-table-column>
        </el-table>
        <div class="block">
          <span class="demonstration">直接前往</span>
          <el-pagination
            :page-size="100"
            layout="prev, pager, next, jumper"
            :total="1000">
          </el-pagination>
        </div>
        <div style=" padding: 10px 0;position:relative">
          <el-input style="width: 200px;margin-top:10px" placeholder="请输入调拨记录ID" suffix-icon="el-icon-search"></el-input>
          <el-input style="width: 200px;margin-top:10px" placeholder="请输入餐具编号" suffix-icon="el-icon-message" class="ml-5"></el-input>
          <el-button type="primary" style="margin-top: 10px">搜索</el-button>
          <el-button type="success" @click="dialogFormVisible = true">添加</el-button>
        </div>
      </el-main>
    </el-container>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        tableData: [
          {
            PurchaseID: 30577,
            PName: '采购餐具名称1',
            PNum: 39,
            PTme: '2023-02-28',
            From: '供应商2',
            Others: '备注1'
          },
          {
            PurchaseID: 41168,
            PName: '采购餐具名称4',
            PNum: 68,
            PTme: '2023-03-27',
            From: '供应商3',
            Others: '备注2'
          },
          {
            PurchaseID: 72637,
            PName: '采购餐具名称5',
            PNum: 85,
            PTme: '2023-07-04',
            From: '供应商1',
            Others: '备注3'
          },
          {
            PurchaseID: 24264,
            PName: '采购餐具名称2',
            PNum: 35,
            PTme: '2023-03-25',
            From: '供应商2',
            Others: '备注4'
          },
          {
            PurchaseID: 63575,
            PName: '采购餐具名称3',
            PNum: 25,
            PTme: '2023-03-04',
            From: '供应商5',
            Others: '备注5'
          },
          {
            PurchaseID: 49883,
            PName: '采购餐具名称4',
            PNum: 61,
            PTme: '2023-06-29',
            From: '供应商4',
            Others: '备注6'
          },
          {
            PurchaseID: 40347,
            PName: '采购餐具名称2',
            PNum: 12,
            PTme: '2023-03-22',
            From: '供应商1',
            Others: '备注7'
          },
          {
            PurchaseID: 88701,
            PName: '采购餐具名称5',
            PNum: 38,
            PTme: '2023-06-26',
            From: '供应商3',
            Others: '备注8'
          },
          // ...
        ],
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        dialogFormVisible: false,
        formLabelWidth: '200px',
      };
    },
    methods: {
      goBack() {
        // 执行退出登录的逻辑
        // 返回登录页
        this.$router.push('/Index');
      },
    }
  }
</script>

<style>
  .el-container:nth-child(7) .el-aside {
    line-height: 440px;
  }
</style>
